Added fake-o waypoint names to generated waypoints; GPS formats seem to care about...
authorparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 3 Dec 2003 02:01:08 +0000 (02:01 +0000)
committerparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 3 Dec 2003 02:01:08 +0000 (02:01 +0000)
gpsbabel/saroute.c

index 276967e8c3f26b72df6b1b298ac371f6521a6aa5..e92f0b32c187aec7487d7abc5d463be8f972dc1e 100644 (file)
@@ -87,6 +87,7 @@ my_read(void)
        unsigned long recsize;
        unsigned char *record;
        unsigned short stringlen;
+       static int serial = 0;
        struct ll {
                long lat;
                long lon;
@@ -150,6 +151,8 @@ my_read(void)
                        wpt_tmp = xcalloc(sizeof (*wpt_tmp), 1);
                        wpt_tmp->latitude = lat;
                        wpt_tmp->longitude = -lon;
+                       wpt_tmp->shortname = xmalloc(7);
+                       sprintf( wpt_tmp->shortname, "\\%5.5x", serial++ );
                        route_add_wpt(track_head, wpt_tmp);
                } else {
                        Skip(infile, recsize);
@@ -212,6 +215,8 @@ my_read(void)
 
                        wpt_tmp->latitude = lat;
                        wpt_tmp->longitude = -lon;
+                       wpt_tmp->shortname = xmalloc(7);
+                       sprintf( wpt_tmp->shortname, "\\%5.5x", serial++ );
                        route_add_wpt(track_head, wpt_tmp);
 
                        latlon++;